﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using System.Data;

namespace DAO
{
    public class ChiTietPhieuThueDAO
    {
        public static DataTable GetAll()
        {
            DataProvider dp = new DataProvider();
            string sql = "Select * From ChiTietPhieuThue";
            DataTable dt = dp.ExecuteQuery(sql);
            return dt;
        }

        public static void ThemChiTietPhieuThue(ChiTietPhieuThueDTO ctpt)
        {
            string sql = string.Format("INSERT INTO QLKhachSan.dbo.ChiTietPhieuThue(MaChiTietPhieuThue, MaPhieuThue, MaKhachHang) VALUES (" + ctpt.MaChiTietPhieuThue + "," + ctpt.MaPhieuThue + "," + ctpt.MaKhachHang + ")");
            DataProvider.ExecuteNonQuery(sql);
        }
    }
}
